package com.yudaxian.sys.service.impl;

import com.yudaxian.sys.entity.Sensor;
import com.yudaxian.sys.mapper.SensorMapper;
import com.yudaxian.sys.service.ISensorService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author yudaxian
 * @since 2023-12-01
 */
@Service
public class SensorServiceImpl extends ServiceImpl<SensorMapper, Sensor> implements ISensorService {

    @Override
    public Sensor getSensorById(Integer id) {
        return this.baseMapper.selectById(id);
    }

    @Override
    public void addSensor(Sensor sensor) {
        this.baseMapper.insert(sensor);
    }

    @Override
    public void updateSensor(Sensor sensor) {
        this.baseMapper.updateById(sensor);
    }

    @Override
    public void deleteSensorById(Integer id) {
        this.baseMapper.deleteById(id);
    }
}
